const fs = require('fs')
const zlib = require('zlib')
const crypto = require('crypto')
let gzip = zlib.createGzip();
const path = require('path')
console.log(process.cwd());
function zlib1 (src) {
  fs.createReadStream(src).pipe(gzip)
    .pipe(fs.createWriteStream(src+'.gz'));
}
// zlib1(__dirname+'/1.txt')
function unZlib (src) {
  fs.createReadStream(src).pipe(zlib.createGunzip())
  .pipe(fs.createWriteStream(path.join(__dirname, path.basename(src, '.gz'))))
}
// unZlib(path.join(__dirname, '1.txt.gz'))
const str = '王烨鑫'
const hash = crypto.createHmac('sha1', str).update('我爱你').digest('hex');
console.log(hash);
